package com.ozan.kemal.text;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import com.ozan.kemal.utils.Constants;

public class LanguageMgr {

	private static Properties prop = null ;	
	private String language = "TR" ;
	

	public LanguageMgr() {
		try {
		
			initialize() ;
		
		} catch (IOException e) {
			
			e.printStackTrace();
		} 
	}

	public void initialize() throws IOException{
		try {
			InputStream is = LanguageMgr.class.getResourceAsStream(Constants.LANGUAGE_PREFIX+"_"+language+".properties");  
			prop = new Properties();  
			prop.load(is);
		} catch (IOException e) {
			e.printStackTrace();
			throw e;
		}  
	}


	public String getString(String key){

		String value= prop.getProperty(key);

		return value;
	}


	public void setLanguage(String language) {
		this.language = language;
	}


	public String getLanguage() {
		return language;
	}


	
}
